

<!DOCTYPE html>
<html class="writer-html5" lang="zh-CN" >
<head>
  <meta charset="utf-8">
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  <title>AIL 1.2 DragonLi &mdash; AIL-docs  文档</title>
  

  
  <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />

  
  
  
  

  
  <!--[if lt IE 9]>
    <script src="../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
        <script src="../_static/jquery.js"></script>
        <script src="../_static/underscore.js"></script>
        <script src="../_static/doctools.js"></script>
        <script src="../_static/language_data.js"></script>
        <script src="../_static/translations.js"></script>
    
    <script type="text/javascript" src="../_static/js/theme.js"></script>

    
    <link rel="index" title="索引" href="../genindex.html" />
    <link rel="search" title="搜索" href="../search.html" />
    <link rel="next" title="AIL 教程" href="../tutorial/index.html" />
    <link rel="prev" title="&lt;no title&gt;" href="2_1.html" /> 
</head>

<body class="wy-body-for-nav">

   
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >
          

          
            <a href="../index.html" class="icon icon-home" alt="Documentation Home"> AIL-docs
          

          
          </a>

          
            
            
          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <p class="caption"><span class="caption-text">目录</span></p>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="index.html">版本介绍</a><ul class="current">
<li class="toctree-l2 current"><a class="current reference internal" href="#">1.2</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#id1">主要更新</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#id2">语法更新</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id3">新的异常处理机制和栈回溯提示</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#id4">其他更新</a></li>
<li class="toctree-l3"><a class="reference internal" href="#bug">Bug修复</a></li>
<li class="toctree-l3"><a class="reference internal" href="#id5">优化</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">入门教程</a></li>
<li class="toctree-l1"><a class="reference internal" href="../library/index.html">标准库参考</a></li>
<li class="toctree-l1"><a class="reference internal" href="../reference/index.html">语言参考</a></li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../index.html">AIL-docs</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="../index.html" class="icon icon-home"></a> &raquo;</li>
        
          <li><a href="index.html">AIL 更新日志</a> &raquo;</li>
        
      <li>AIL 1.2  DragonLi</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
            
            <a href="../_sources/whatsnew/1_2.rst.txt" rel="nofollow"> View page source</a>
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
  <div class="section" id="ail-1-2-dragonli">
<h1>AIL 1.2  DragonLi<a class="headerlink" href="#ail-1-2-dragonli" title="永久链接至标题">¶</a></h1>
<p><strong>2021年2月</strong></p>
<p>DragonLi版本相比1.0版本，提高了稳定性，增加了诸多元素。</p>
<div class="section" id="id1">
<h2>主要更新<a class="headerlink" href="#id1" title="永久链接至标题">¶</a></h2>
<div class="section" id="id2">
<h3>语法更新<a class="headerlink" href="#id2" title="永久链接至标题">¶</a></h3>
<p>DragonLi 版本的代码块增加了对 <code class="code docutils literal notranslate"><span class="pre">{</span> <span class="pre">}</span></code> 的支持，从此不必再写 <code class="code docutils literal notranslate"><span class="pre">end</span></code> 这类单词来作为块的开始或结尾。但AIL仍然保留了这种以单词作为标志的块语法。</p>
</div>
<div class="section" id="id3">
<h3>新的异常处理机制和栈回溯提示<a class="headerlink" href="#id3" title="永久链接至标题">¶</a></h3>
<p>DragonLi 版本重写了异常处理机制，得益于虚拟机内部新增的 <em>block</em> 机制，AIL 的异常处理和捕获机制能更稳定运行。</p>
<p>栈回溯一改以往令人迷惑的提示方式，提供了更为友好的栈回溯提示 (与Python的栈回溯提示类似)：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Traceback</span> <span class="p">(</span><span class="n">most</span> <span class="n">recent</span> <span class="n">call</span> <span class="n">last</span><span class="p">):</span>
  <span class="n">File</span> <span class="s1">&#39;example_err.ail&#39;</span><span class="p">,</span> <span class="n">line</span> <span class="mi">9</span><span class="p">,</span> <span class="ow">in</span> <span class="o">&lt;</span><span class="n">main</span><span class="o">&gt;</span>
    <span class="nb">print</span> <span class="n">f</span><span class="p">()</span>
  <span class="n">File</span> <span class="s1">&#39;example_err.ail&#39;</span><span class="p">,</span> <span class="n">line</span> <span class="mi">6</span><span class="p">,</span> <span class="ow">in</span> <span class="n">f</span>
    <span class="k">return</span> <span class="n">f2</span><span class="p">()</span>
  <span class="n">File</span> <span class="s1">&#39;example_err.ail&#39;</span><span class="p">,</span> <span class="n">line</span> <span class="mi">4</span><span class="p">,</span> <span class="ow">in</span> <span class="n">f</span><span class="o">.</span><span class="n">f2</span>
    <span class="k">return</span> <span class="mi">1</span> <span class="o">/</span> <span class="mi">0</span>
<span class="ne">ZeroDivisionError</span><span class="p">:</span> <span class="n">division</span> <span class="n">by</span> <span class="n">zero</span>
</pre></div>
</div>
</div>
</div>
<div class="section" id="id4">
<h2>其他更新<a class="headerlink" href="#id4" title="永久链接至标题">¶</a></h2>
<ul class="simple">
<li><p>import 机制</p></li>
<li><p>闭包</p></li>
<li><p>参数解包，可变参数</p></li>
<li><p>自增/自减运算符（左侧）</p></li>
</ul>
</div>
<div class="section" id="bug">
<h2>Bug修复<a class="headerlink" href="#bug" title="永久链接至标题">¶</a></h2>
<ul class="simple">
<li><p>try-catch-finally 跳转问题</p></li>
<li><p>continue, break 跳转问题</p></li>
<li><p>load 交叉导入问题</p></li>
<li><p>函数调用异常问题</p></li>
</ul>
</div>
<div class="section" id="id5">
<h2>优化<a class="headerlink" href="#id5" title="永久链接至标题">¶</a></h2>
<ul class="simple">
<li><p>优化了load的导入方式</p></li>
<li><p>优化了基本类型运算的速度</p></li>
</ul>
</div>
</div>


           </div>
           
          </div>
          <footer>
  
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
      
        <a href="../tutorial/index.html" class="btn btn-neutral float-right" title="AIL 教程" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
      
      
        <a href="2_1.html" class="btn btn-neutral float-left" title="&lt;no title&gt;" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
      
    </div>
  

  <hr/>

  <div role="contentinfo">
    <p>
        
        &copy; 版权所有 2020, ChenHongbo

    </p>
  </div>
    
    
    
    Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a
    
    <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a>
    
    provided by <a href="https://readthedocs.org">Read the Docs</a>. 

</footer>

        </div>
      </div>

    </section>

  </div>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>